<?php
class ControllerAccountActiveaccount extends Controller {
	public function index() {
		$this->load->model ( 'account/customer' );
		$this->load->model ( 'account/passreset' );
		
		$arrayemails = $this->model_account_customer->getEmail ();
		
		foreach ( $arrayemails as $arrayemail ) {
			
			if (strcmp ( md5 ( $arrayemail ['email'] ), $_REQUEST ['codeActive'] ) == 0) {
				$this->model_account_customer->editUsername ( $arrayemail ['email'], $_REQUEST ['user'] );
				$this->model_account_customer->editPasswordnew ( $arrayemail ['email'], $_REQUEST ['newpass'] );
				break;
			}
		}
		
		$this->id = 'content';
		$this->template = $this->config->get ( 'config_template' ) . 'account/activeaccount.phtml';
		
		$this->layout = 'common/layout';
		
		$this->render ();
	}
}
?>